<template>
  <div class="app-container clearfix">  
      <el-button @click="getList">刷新</el-button>
      <el-table
      :data="list"
      border
      style="width: 100%">
      <el-table-column
        prop="content"
        label="内容">
        <template slot-scope="{row}">
          <span>{{ row.content }}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="来源"
        width="100">
        <template slot-scope="{row}">
          <span>{{ row.originate }}</span>
        </template>
      </el-table-column>
      <el-table-column
        prop="publishTime"
        label="发布时间"
        width="200">
      </el-table-column>
      </el-table>
  </div>
</template>

<script>
import waves from '@/directive/waves' // waves directive
import Pagination from '@/components/Pagination' // secondary package based on el-pagination
import {getSymbol} from '@/utils/symbol' // secondary package based on el-pagination
import {getRealtimeList} from '@/api/knowledge/realtime'


export default {
  name: 'financeDashboard',
  components: { Pagination },
  directives: { waves },
  filters: {
  },
  data() {
    return {
      
      socket:"",
      tableKey: 0,
      list: null,
      windowHeight:"600",
      total: 0,
      listLoading: false,
      documentationList:[],
      connected:"loading",
      filterForm: {
        page: 1,
        size: 10,
        localSymbol:"",
        status:5,
        style:"0",
        keyword: undefined
      }
    }
  },
  created() {
    let symbolData = window.localStorage.getItem('localSymbol')
    symbolData = JSON.parse(symbolData)
    try {
      this.localSymbol = symbolData.code
    } catch (error) {
      
    }
    this.getList()
  },
  destroyed () {
  },
  methods: {
    handleSubscribeSubmit:function(){
        let _this = this
        _this.send({
            "conversationType":"foundation.device.save",
            "message":_this.subscribeForm,
            "target":{"id":"3"}
        })
    },
    getList:function(){
      let _this = this;
      console.log("期权",_this.filterForm)
      getRealtimeList(_this.filterForm).then((response) => {
        console.log("getList",response)
          if (response.code === 200) {
            this.list = response.data.list
            this.total = response.data.total
          } else {
            _this.$message({
              message: response.msg,
              type: 'error'
            })
          }
      })
    },
    getDeviceList:function(){
      this.send({
        "conversationType":"foundation.device.list",
        "message":{},
        "target":{"id":"3"}
      })
    },
    handleFilter() {
      this.filterForm.page = 1
      this.getList()
    },
    sortChange:function(){

    }
  }
}
</script>
<style>
.filter { float: left; width: 160px; padding: 20px; min-height: 600px; }
.article { float: left; width: 800px; }
.article-item { width: 800px; height: 200px; margin-right: 25px; }
.article-item-text { float: left; width:600px; }
.article-item-icon { float: right; width:200px; height:150px; padding-left: 50px; }
.article-item-icon img { width:100%; height:100%; border-radius: 10px; }
</style>